import {DbContext} from '@codefree/badger/service'

const db = DbContext.Sequelize;

export type OperationLogEntity = {
    optSummary: String,
    optType: Number,
    optCode: String,
    businessData: String,
    inUserId: Number,
    inUserName: String
}

const operationLogEntity: OperationLogEntity = {
    optSummary: db.STRING(500),
    optType: db.TINYINT,
    optCode: db.STRING(50),
    businessData: db.TEXT,
    inUserId: db.INTEGER,
    inUserName: db.STRING(50)

}

export default (sequelize) => {
    let OperationLog = sequelize.define("operation_log", operationLogEntity, DbContext.defaultOptions)

    return {
        name: 'OperationLog',
        define: OperationLog
    }
}